Standard XML attachment
The standard attachment is an aggregate of all the other common function-specific attachment types. It should be used for all new XML scripting requirements. XML scripts written to use the standard XML attachment will typically be much clearer to read and understand.
Any XML scripts written to use the previous, function-specific attachment types will continue to work as normal.
Schema
<mkzAttachment type="standard">
<onPreview>
<adjust property="text">{value}</adjust>
</onPreview>
<onPreSubmit>
<checkPageSizes failAction="block|reject|resize" />
<setAddress metadata="true|false" box="X,Y,W,H" options="nn" />
<checkValidAddress minimumLines="nn" accuracy="strict|postcode|none" failAction="block|reject|none" />
<checkOtherAddress startPage="nn" failAction="block|reject|none" [box="X,Y,W,H"] />
<discardLetter/>
<xmlPath>{folder-where-XML-files-are-stored}</xmlPath>
<appendXml>{XML-filename}</appendXml>
<stampText [scan|identifier="text"] pages="page-specifier" format="format-specifier" >{text}</stampText>
<stampRect pages="page-specifier" format="format-specifier" />
<stampImage [scan|identifier="filename"] pages="page-specifier" format="format-specifier" >{filename}</stampImage>
<stampBarcode [scan|identifier="code"] pages="page-specifier" format="format-specifier" >{code}</stampBarcode>
<stampDataMatrix [scan|identifier="code"] pages="page-specifier" format="format-specifier" >{code}</stampDataMatrix>
<dataQuery>
<sqlConnection>{connection-string}</sqlConnection>
<sqlParameter identifier="name" [direction="out"] [type="int"] >param-name</sqlParameter>
<sqlColumn identifier="name" [type="int"] >column-name</sqlColumn>
<sqlExecuteQuery>{stored-procedure-name}</sqlExecuteQuery>
<csvFilename>{CSV-file-full-path-name}</csvFilename>
<csvColumn identifier="name" >column-name-or-index</csvColumn>
<csvExecuteQuery csvColumn="name-or-index" equals="{text}" | contains="{text}" />
</dataQuery>
</onPreSubmit>
<onSubmit>
<letterClass>{first|second}</letterClass>
<letterChroma>{colour|mono}</letterChroma>
<letterPlex>{simplex|duplex}</letterPlex>
<letterUser>user-ID</letterUser>
<letterOutput>{output-ID}</letterOutput>
<letterStatus>{status-name}
[<rejectionCode>{code}</rejectionCode>]
</letterStatus>
<letterDelivery>{postal|electronic}</letterDelivery>
<letterName [scan|identifier] >{letter-name}</letterName>
<letterStream [scan|identifier] >{stream-name}</letterStream>
<pdfPath>{folder-where-PDF-files-are-stored}</pdfPath>
<appendPdf [identifier="PDF-filename"]
[mergeWithLetter="true|false" | useAsBackground="true|false" | insertRef="{true|false}"]
[colour="true|false"] [first="true|false"] [map="true|false"] >{PDF-filename}</appendPdf>
<mergePdf [identifier="PDF-filename"] position="nn" >{PDF-filename}</mergePdf>
<insertPages position="nn" pages="mm" />
<deletePages position="nn" pages="mm" />
<customData [scan|identifier] [dateFormat="yyyyMMdd"]
[property="prop-name"] [metadata="meta-name"]
field="ff" | multiField="ff,gg,hh..." [parse="split-chars"] >{default-text}
</customData>
<stampText [scan|identifier="text"] pages="page-specifier" format="format-specifier" >{text}</stampText>
<stampRect pages="page-specifier" format="format-specifier" />
<stampImage [scan|identifier="filename"] pages="page-specifier" format="format-specifier" >{filename}</stampImage>
<stampBarcode [scan|identifier="code"] pages="page-specifier" format="format-specifier" >{code}</stampBarcode>
<stampDataMatrix [scan|identifier="code"] pages="page-specifier" format="format-specifier" >{code}</stampDataMatrix>
<emailSubject [scan|identifier] >{subj}</emailSubject>
<emailTo [scan|identifier] >{recipient}</emailTo>
<emailFrom [scan|identifier] >{sender}</emailFrom>
<emailCc [scan|identifier] >{recipient}</emailCc>
<emailBody [scan|identifier] >{text}</emailBody>
<emailBodyFolder [scan|identifier] >{pathname}</emailBodyFolder>
<emailBodyFile [scan|identifier] >{filename}</emailBodyFile>
<emailAttachmentName [scan|identifier] >{name}</emailAttachmentName>
<emailReplyTo [scan|identifier] >{recipient}</emailReplyTo>
<smsTo [scan|identifier] provider="name" >{recipient}</smsTo>
<smsFrom [scan|identifier] >{sender}</smsFrom>
<smsBody [scan|identifier] >{text}</smsBody>
<smsBodyFile [scan|identifier] >{filename}</smsBodyFile>
<msgDelivery>{method}</msgDelivery>
<msgPassword>{passcode}</msgPassword>
<msgSubstitute [scan|identifier] subKey="@name@" >{substitution-text}</msgSubstitute>
<useNHSSecureEmail/>
<checkRequiredValues/>
<reselectOutput/>
<combineLetter>
<combineAddress/> | <combineRecipient/>
<combinePostcode/>
<combineSSC/>
<combineDPS/>
<combineField [scan|identifier] >{default-text}</combineField>
<topmost />
</combineLetter>
<carbonCopy>
<ccAddresses identifier="identifier-name" [accuracy="all|any"] >{default}</ccAddresses>
<ccSingleAddress identifier="identifier-name" [accuracy="all|any"] >{default}</ccSingleAddress>
<coverLetterFolder>{path-to-cover-letters}</coverLetterFolder>
<coverLetter>{cover-letter-filename}</coverLetter>
<stripAttachments [stripSupplements="true|false"] />boolean</stripAttachments>
<ccTemplate>{template-ID}</ccTemplate>
</carbonCopy>
<dataQuery>
<sqlConnection>{connection-string}</sqlConnection>
<sqlParameter identifier="name" [direction="out"] [type="int"] >param-name</sqlParameter>
<sqlColumn identifier="name" [type="int"] >column-name</sqlColumn>
<sqlExecuteQuery>{stored-procedure-name}</sqlExecuteQuery>
<csvFilename>{CSV-file-full-path-name}</csvFilename>
<csvColumn identifier="name" [type="int"]>column-name-or-index</csvColumn>
<csvExecuteQuery csvColumn="name-or-index" equals="{text}" | contains="{text}" />
</dataQuery>
</onSubmit>
<onRelease>
<loadCustomData/>
<makePdfFileCopy folderName="name" fileName="name" includeUnique="random|time|timeMs" />
<sendEmail attachLetter="true" />
<sendSms/>
</onRelease>
<onRelay>
<stampText [scan|identifier="text"] pages="page-specifier" format="format-specifier" >{text}</stampText>
<stampRect pages="page-specifier" format="format-specifier" />
<stampImage [scan|identifier="filename"] pages="page-specifier" format="format-specifier" >{filename}</stampImage>
<stampBarcode [scan|identifier="code"] pages="page-specifier" format="format-specifier" >{code}</stampBarcode>
<stampDataMatrix [scan|identifier="code"] pages="page-specifier" format="format-specifier" >{code}</stampDataMatrix>
</onRelay>
</mkzAttachment>
The XML can be executed during any phase. N.B. The OnPreview phase is only relevant to the QuickPost page (PostBox client)
The XML supports the following elements during OnPreSubmit. There can be only one instance of each of these
<ignoreValidAddressCheck>true</ignoreValidAddressCheck> Override the check for address validity.
If this element if true, then the check for a valid address is ignored.
<ignoreOtherAddressCheck>true</ignoreOtherAddressCheck> Override the check for addresses on subsequent pages.
If this element if true, then the check for other addresses (which might indicate a need to split the letter file into individual letters) is ignored.
<discardLetter>true</discardLetter> Override the check for addresses on subsequent pages.
If this element if true, then all letter processing will be discontinued, the PDF file will be deleted and no database record will be created. This element is normally used to discard “heartbeat” messages. It should not be used for normal letter processing since all record of the letter’s existence is erased.
To prevent processing of a genuine letter, use the <letterStatus>rejected</letterStatus> element.
The XML supports the following elements during OnSubmit. There can be multiple instances of any of these.
<letterClass> Set the letter postage class.
Changes the letter class based on text in an identifier or scanned from the letter. Valid options are "first" or "second".
<letterChroma> Set the letter chroma (colour intensity).
Changes the letter chroma based on text in an identifier or scanned from the letter. Valid options are "colour" or "mono".
<letterPlex> Set the letter plex. (double/single sided)
Changes the letter plex based on text in an identifier or scanned from the letter. Valid options are "simplex" or "duplex".
<letterUser> Set the letter user (the user who submitted the letter).
Changes the ID of the sending user based on text in an identifier or scanned from the letter. Valid options are the integer ID of an existing user from the same organisation. You cannot change the User ID to that of a user from a different organisation.
<letterOutput> Set the letter output.
Changes the ID of the destination output queue based on text in an identifier or scanned from the letter. Valid options are the integer ID of an existing output.
<letterStatus> Set the status.
Changes the ID of the current letter processing status based on text in an identifier or scanned from the letter. Valid options are "pending", "queued", "deleted", "rejected" or "outputAssigned". The <rejectionCode> element is only valid for "rejected" status
<letterDelivery> Set the delivery method.
Changes the intended delivery method for the letter based on text in an identifier or scanned from the letter. Valid options are "electronic" and "postal".
<reselectOutput>true</reselectOutput>
Force Hybridmail to reselect the most appropriate output queue for this letter now that it has been modified.
An optional element, but should really be considered mandatory if any of the above elements change properties of the parent letter and the output has not been set to a known, appropriate value. Setting this to true causes the auto-assigned output queue to be recalculated based on changes that may have been made to the letter properties.
<appointmentDate changeClassDays="minval,maxval" dontSendDays="rejectval" > <appointmentDate>
If the text in an identifier or scanned from the letter contains a valid date, the number of working-days between "today" and the appointment date is calculated and compared with the values in the attributes.
If working-days is between minval and maxval (inclusive) then the letter is changed to first-class.
If working-days is less than or equal to rejectval then the letter is rejected and its status is set to Rejected:AppointmentTooSoon.
If the text in an identifier or scanned from the letter does not contain a valid date, no action is taken.
Examples
If the appointment is 10 working days ahead or less, change the letter to first class. However if the appointment is only 3 working days ahead or less, don't bother sending the letter at all.
<appointmentDate" scan="20,40,150,180" date="future" changeClassDays="4,10" dontSendDays="3" >
The following table assumes that the scanned date of the appointment is "Friday 18th July" and that, before processing this element, the letter was 'Queued' and 'Second-class'.
| Tues 1st July | 13 | Queued | Second |
| Weds 2nd July | 12 | Queued | Second |
| Thurs 3rd July | 11 | Queued | Second |
| Fri 4th July | 10 | Queued | First |
| Sat 5th July | 9 | Queued | First |
| Sun 6th July | 9 | Queued | First |
| Mon 7th July | 9 | Queued | First |
| Tues 8th July | 8 | Queued | First |
| Weds 9th July | 7 | Queued | First |
| Thurs 10th July | 6 | Queued | First |
| Fri 11th July | 5 | Queued | First |
| Sat 12th July | 4 | Queued | First |
| Sun 13th July | 4 | Queued | First |
| Mon 14th July | 4 | Queued | First |
| Tues 15th July | 3 | Rejected | N/A |
| Weds 16th July | 2 | Rejected | N/A |
| Thurs 17th July | 1 | Rejected | N/A |
| Fri 18th July | 0 | Rejected | N/A |